package com.cskaoyan.user.service.impl;

import com.cskaoyan.mall.commons.util.CookieUtil;
import com.cskaoyan.user.service.ILoginOutService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author Tezel
 * @since 2022/07/30 15:01
 */
@Slf4j
@Service
public class LoginOutServiceImpl implements ILoginOutService {

    @Override
    public void loginOut(HttpServletRequest servletRequest, HttpServletResponse servletResponse) {

        Cookie cookie = CookieUtil.genCookie("access_token", null, "/", 0);

        CookieUtil.setCookie(servletResponse, cookie);


    }
}
